# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>

_php=php7
pkgname=mongo-${_php}-library
_realname=mongo-php-library
pkgver=1.7.0
pkgrel=0
pkgdesc="High-level abstraction around the lower-level drivers for PHP"
url="https://github.com/mongodb/mongo-php-library"
arch="noarch"
license="Apache-2.0"
depends="${_php}-json ${_php}-openssl ${_php}-mongodb>1.8.0"
makedepends="composer ${_php}-dom ${_php}-simplexml ${_php}-tokenizer ${_php}-xml ${_php}-xmlwriter"
subpackages="$pkgname-doc"
options="!check" # require mongodb server
source="$_realname-$pkgver.tar.gz::https://github.com/mongodb/$_realname/archive/$pkgver.tar.gz"
builddir="$srcdir"/$_realname-$pkgver

build() {
	return 0
}

package() {
	mkdir -p "$pkgdir"/usr/share/doc/mongo-${_php}-library/docs
	mkdir -p "$pkgdir"/usr/lib/${_php}/vendor/mongodb/mongodb
	mv src/* "$pkgdir"/usr/lib/${_php}/vendor/mongodb/mongodb
	mv tests "$pkgdir"/usr/lib/${_php}/vendor/mongodb/mongodb/
	mv docs/* "$pkgdir"/usr/share/doc/mongo-${_php}-library/docs
	mv LICENSE README.md "$pkgdir"/usr/share/doc/mongo-${_php}-library
}

sha512sums="b3043bc98dc8ecf408ff46d8051f6d1ddae01e334e097d065e5fd85fbcbb4c3e4d94732e831023b93058591c153188efe973546e03213749d2f9758b6c1913e1  mongo-php-library-1.7.0.tar.gz"
